home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / beermon / init.s < prev    next >
Text File  |  1980-01-03  |  1KB  |  76 lines

  1. ; this proggi loads the monifile "moni_abs" into the 256kb module
  2. ; it should be there, if not you may be a la...
  3.  
  4. run:    move.l 4.w,a6
  5.     lea dosname(pc),a1
  6.     jsr -408(a6)
  7.     move.l d0,a6
  8.  
  9.     lea file0(pc),a5
  10.     bsr.w openfile
  11.     bne.s getit
  12.     lea file1(pc),a5
  13.     bsr.w openfile
  14.     bne.s getit
  15.     lea file2(pc),a5
  16.     bsr.s openfile
  17.     bne.s getit
  18.     lea file3(pc),a5
  19.     bsr.s openfile
  20.  
  21.     beq.s nofile
  22.  
  23. getit:    lea $f00002,a5
  24.     lea $f30002,a4
  25.     move.l #"beer",d1
  26.     clr.l (a5)
  27.     move.l d1,(a4)
  28.     tst.l (a5)
  29.     bne.s nofile
  30.     cmp.l (a4),d1
  31.     bne.s nofile        ;ugh, we have no 256kb ram...
  32.  
  33.     lea 2(a5),a0
  34.     moveq #-1-1,d0
  35.     moveq #0,d1
  36. clrit:    move.l d1,(a0)+        ;$3fffc bytes
  37.     dbf d0,clrit
  38.  
  39.     move.w #$4ef9,(a5)+    ;JMP instruction, which is expected
  40.     move.l #$f00008,(a5)+    ;by A1000 boot rom
  41.     
  42.     move.l d7,d1
  43.     move.l a5,d2
  44.     move.l #65536*4-6-2,d3
  45.     jsr -42(a6)    
  46.     move.l d7,d1
  47.     jsr -36(a6)
  48.  
  49.     move.w #$1111,$f00000    ;yo, all is ok
  50. quit:    move.l a6,a1
  51.     move.l 4.w,a6
  52.     jsr -414(a6)
  53.     clr.l d0
  54.     rts
  55.  
  56. nofile:    moveq #-1,d0        ;blink means you've been nasty
  57. err:    move.w $dff006,$dff180
  58.     dbf d0,err
  59.     bra.s quit
  60.  
  61. openfile:
  62.     move.l a5,d1
  63.     move.l #1005,d2
  64.     jsr -30(a6)
  65.     move.l d0,d7
  66.     rts
  67.  
  68. dosname:dc.b "dos.library",0
  69. even
  70. file0:    dc.b ":moni_abs",0
  71. file1:    dc.b "dh0:d/moni_abs",0
  72. file2:    dc.b "df0:moni_abs",0
  73. file3:    dc.b "df1:moni_abs",0
  74. oi:    dc.b "beermacht"
  75.  
  76.